package com.ylabz.wavemail;

import java.util.List;
import java.util.logging.Logger;

import com.google.wave.api.AbstractRobotServlet;
import com.google.wave.api.Blip;
import com.google.wave.api.RobotMessageBundle;
import com.google.wave.api.TextView;
import com.google.wave.api.Wavelet;

public class WaveMailServlet extends AbstractRobotServlet {
   private static final Logger log = Logger.getLogger(Mail.class.getName());

   // Change this to the Wave ID of your robot.
   private static String myParticipantId = "artfx@appspot.com";

   @Override
   public void processEvents(RobotMessageBundle events) {
      try {
         Wavelet wavelet = events.getWavelet();
         Blip blip = wavelet.appendBlip();
         TextView textView = blip.getDocument();
         textView.append("blah test abcd");
         List<Mail> l = Mail.getMessages();
         textView.append("blah " + l.get(0).getSubject());
      } catch (Exception e) {
         log.warning(e.getMessage());
      }
   }
}